#include"list.h"


void test1()
{
	LTNode* plist = LTInit();
	LTPushBack(plist, 1);
	LTPushBack(plist, 2);
	LTPushBack(plist, 3);
	LTPushBack(plist, 4);
	LTPushBack(plist, 5);
	ListPrint(plist);
	LTPushFront(plist, 6);
	LTPushFront2(plist, 7);
	ListPrint(plist);
}
void test2()
{
	LTNode* plist = LTInit();
	LTPushBack(plist, 1);
	LTPushBack(plist, 2);
	LTPushBack(plist, 3);
	LTPushBack(plist, 4);
	LTPushBack(plist, 5);
	ListPrint(plist);
	LTPopFront(plist);
	LTPopFront(plist);
	ListPrint(plist);
	LTPopBack(plist);
	ListPrint(plist);
}
void test3()
{
	LTNode* plist = LTInit();
	LTPushBack(plist, 1);
	LTPopFront2(plist);
	ListPrint(plist);
	LTPopFront2(plist);
	ListPrint(plist);
}
void test4()
{
	LTNode* plist = LTInit();
	LTPushBack(plist, 1);
	LTPushBack(plist, 2);
	LTPushBack(plist, 3);
	LTPushBack(plist, 4);
	LTPushBack(plist, 5);
	ListPrint(plist);

	LTPushBack(plist, 10);
	ListPrint(plist);
	LTPushFront(plist, 20);
	ListPrint(plist);

	LTPopFront2(plist);
	LTPopFront2(plist);
	LTPopFront2(plist);
	ListPrint(plist);

	LTPopBack(plist);
	LTPopBack(plist);
	LTPopBack(plist);
	ListPrint(plist);
}

test5()
{
	LTNode* plist = LTInit();
	LTPushBack(plist, 1);
	LTPushBack(plist, 2);
	LTPushBack(plist, 3);
	LTPushBack(plist, 4);
	LTPushBack(plist, 5);
	LTNode* pos = LTFind(plist,3);
	if (pos)
	{
		LTInsert(pos, 30);
	}
	ListPrint(plist);
	LTDestroy(plist);
	plist = NULL;

}
int main()
{
	test5();
	return 0;
}